<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>学生信息管理</title>
<meta name="description" content="这是一个 index 页面">
<meta name="keywords" content="index">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="${ctx}/assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed"
	href="${ctx}/assets/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />

<!-- 
<link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css" />
<script src="${ctx}/assets/js/jquery.min.js"></script>
-->
<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.7.2/css/amazeui.min.css" />
<script src="https://cdn.bootcss.com/jquery/2.2.3/jquery.js"></script>

<link rel="stylesheet" href="${ctx}/assets/css/app.css">

</head>

<body data-type="widgets">
	<script src="${ctx}/assets/js/theme.js"></script>
	<%@ include file="../jspf/adminheader.jspf"%>
	<div class="am-g tpl-g">
		<!-- 内容区域 -->
		<div class="row-content" style="margin-left: 240px;">
			<div class="row-content am-cf">
				<div class="row">
					<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
						<div class="widget am-cf">
							<div class="widget-head am-cf">
								<div class="widget-title am-fl">导入学生数据</div>
								<div class="widget-function am-fr">
									<a href="javascript:;" class="am-icon-cog"></a>
								</div>
							</div>
							<div class="widget-body am-fr">
								<form class="am-form tpl-form-border-form tpl-form-border-br"
									method="post" action="import" enctype="multipart/form-data">

									<div class="am-form-group">
										<label for="dept" class="am-u-sm-3 am-form-label">部门 <span
											class="tpl-form-line-small-title">dept</span>
										</label>
										<div class="am-u-sm-9">
											<input type="text" class="tpl-form-input" id="dept"
												name="dept" placeholder="请输入部门" list="depts" />
											<datalist id="depts"></datalist>
										</div>
									</div>
									<div class="am-form-group">
										<label for="clazz" class="am-u-sm-3 am-form-label">班级
											<span class="tpl-form-line-small-title">clazz</span>
										</label>
										<div class="am-u-sm-9">
											<input type="text" class="tpl-form-input" id="clazz"
												name="clazz" placeholder="请输入班级" list="clazzes" />
											<datalist id="clazzes"></datalist>
										</div>
									</div>
									<div class="am-form-group">
										<label for="file" class="am-u-sm-3 am-form-label">XLS
											<span class="tpl-form-line-small-title">excel</span>
										</label>
										<div class="am-u-sm-7">
											<input type="file" id="file" name="file" required="required" />
										</div>
										<div class="am-u-sm-2">
											<a class="am-btn" href="exportTemp">导出模板</a>
										</div>
									</div>

									<div class="am-form-group">
										<div class="am-u-sm-9 am-u-sm-push-3">
											<button type="submit"
												class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 
	<script src="${ctx}/assets/js/amazeui.min.js"></script>
	 -->
	<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
	<script src="${ctx}/assets/js/app.js"></script>
	<script type="text/javascript">
		//获取班级的ajax
		function getclazzes() {
			$.ajax({
				url : "getclazzes",
				type : "get",
				async : false,
				success : function(data) {
					$("#clazzes").empty();
					for ( var i in data) {
						console.log(data[i].name);
						$("#clazzes").append(
								"<option>" + data[i].name + "</option>")
					}
				}
			});
		}
		function getdepts() {
			$.ajax({
				url : "getdepts",
				type : "get",
				async : false,
				success : function(data) {
					$("#depts").empty();
					for ( var i in data) {
						console.log(data[i].name);
						$("#depts").append(
								"<option>" + data[i].name + "</option>")
					}
				}
			});
		}
		getclazzes();
		getdepts();
	</script>
</body>

</html>